<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<ui:composition template="/WEB-INF/template/basicTemplate.xhtml">

	<ui:define name="content">
		<head>
<title><h:outputText value="#{msg.completeQuest}" /></title>
		</head>
		<br />
		<f:event listener="#{chestionareBean.verify()}" type="preRenderView"></f:event>

		<h:form id="form1">
			<div align="center">
				<ui:repeat var="intrebare" value="#{chestionareBean.intrebari}"
					varStatus="index">
					<h:outputText value="#{index.index+1}. #{intrebare.intrebare}"
						style="font-weight:bold;" />
					<br />
					<ui:repeat value="#{intrebare.raspunsuri}" var="optiune"
						varStatus="index">
						<h:panelGrid columns="2" rendered="#{intrebare.tip == 3}"
							style="border:0px;">
							<h:selectBooleanCheckbox value="#{optiune.selectat}" />
							<h:outputLabel value="#{optiune.raspuns}" />
						</h:panelGrid>
					</ui:repeat>


					<h:selectOneRadio value="#{intrebare.selectat}"
						rendered="#{intrebare.tip == 2}" layout="pageDirection">

						<f:selectItems value="#{intrebare.raspunsuri}" var="c"
							itemLabel="#{c.raspuns}" itemValue="#{c.id}" />
					</h:selectOneRadio>

					<h:inputTextarea rendered="#{intrebare.tip == 1}"
						value="#{intrebare.raspuns}"
						style="font-family: Georgia; color: #191997; font-size: 14">
					</h:inputTextarea>
					<br />

				</ui:repeat>
				<h:commandButton value="#{msg.save}" styleClass="button"
					action="#{chestionareBean.salveaza()}" />
				<br />
				<h:commandButton value="#{msg.back}" styleClass="button"
					action="chestionare.xhtml" immediate="true" />
				<br></br>
				<h:commandButton value="#{msg.logout}" styleClass="button"
					action="#{adminBean.logOut()}" immediate="true" />
				<br></br>

			</div>

		</h:form>

	</ui:define>

</ui:composition>
</html>